package com.zqh.elasticsearch.controller;

import com.zqh.elasticsearch.service.ElasticSearchService;
import com.zqh.myfmmall.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-03-05 23:00
 */
@RestController
@RequestMapping("elasticsearch")
public class ElasticSearchController{
    @Autowired
    private ElasticSearchService elasticSearchService;

    @GetMapping("product/{pageNum}/{pageSize}")
    public Result searchProduct(@RequestParam("key") String key,
                                @PathVariable("pageNum") Integer pageNum,
                                @PathVariable("pageSize") Integer pageSize){
        return elasticSearchService.searchProduct(key,pageNum,pageSize);
    }

}
